<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>FastDFS 分布式文件系统架构解析</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
        }
        .serif-font {
            font-family: 'Noto Serif SC', serif;
        }
        .gradient-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .feature-icon {
            transition: all 0.3s ease;
        }
        .feature-icon:hover {
            transform: scale(1.1) rotate(5deg);
        }
        .drop-cap::first-letter {
            float: left;
            font-size: 4rem;
            line-height: 3rem;
            padding-right: 0.5rem;
            margin-top: 0.5rem;
            font-weight: 700;
            color: #667eea;
        }
        .section-divider {
            background: linear-gradient(to right, transparent, #e5e7eb, transparent);
            height: 1px;
            margin: 3rem 0;
        }
        @keyframes float {
            0% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0px); }
        }
        .float-animation {
            animation: float 3s ease-in-out infinite;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="relative overflow-hidden bg-gradient-to-br from-purple-900 via-indigo-800 to-blue-900 text-white">
        <div class="absolute inset-0 bg-black opacity-20"></div>
        <div class="relative container mx-auto px-6 py-24">
            <div class="max-w-4xl mx-auto text-center">
                <h1 class="text-5xl md:text-7xl font-bold mb-6 serif-font">
                    FastDFS
                    <span class="block text-3xl md:text-4xl mt-4 font-light">分布式文件系统架构深度解析</span>
                </h1>
                <p class="text-xl md:text-2xl mb-8 opacity-90 leading-relaxed">
                    探索高性能、高可用的分布式存储解决方案
                </p>
                <div class="flex justify-center space-x-8 text-sm md:text-base">
                    <div class="flex items-center">
                        <i class="fas fa-server mr-2"></i>
                        <span>高可用架构</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-expand-arrows-alt mr-2"></i>
                        <span>无限扩展</span>
                    </div>
                    <div class="flex items-center">
                        <i class="fas fa-tachometer-alt mr-2"></i>
                        <span>极致性能</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="absolute bottom-0 left-0 right-0">
            <svg viewBox="0 0 1440 120" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path d="M0 120L60 110C120 100 240 80 360 70C480 60 600 60 720 65C840 70 960 80 1080 85C1200 90 1320 90 1380 90L1440 90V120H1380C1320 120 1200 120 1080 120C960 120 840 120 720 120C600 120 480 120 360 120C240 120 120 120 60 120H0V120Z" fill="#F9FAFB"/>
            </svg>
        </div>
    </section>

    <!-- Introduction -->
    <section class="container mx-auto px-6 py-16">
        <div class="max-w-4xl mx-auto">
            <div class="bg-white rounded-2xl shadow-xl p-8 md:p-12">
                <p class="text-lg leading-relaxed text-gray-700 drop-cap">
                    FastDFS 的内部结构设计简洁高效，通过 Tracker Server 的调度、Storage Server 的冗余存储、以及客户端的负载均衡等机制，确保了系统的高可用性、扩展性和性能，特别适合大规模文件存储和分发的场景。
                </p>
            </div>
        </div>
    </section>

    <!-- Architecture Visualization -->
    <section class="container mx-auto px-6 py-8">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-3xl font-bold text-center mb-12 gradient-text">系统架构全景图</h2>
            <div class="bg-white rounded-2xl shadow-xl p-8">
                <div class="mermaid">
                    graph TB
                        subgraph "客户端层"
                            C1[客户端1]
                            C2[客户端2]
                            C3[客户端N]
                        end
                        
                        subgraph "调度层"
                            T1[Tracker Server 1]
                            T2[Tracker Server 2]
                        end
                        
                        subgraph "存储层"
                            subgraph "Group 1"
                                S1[Storage Server 1-1]
                                S2[Storage Server 1-2]
                            end
                            subgraph "Group 2"
                                S3[Storage Server 2-1]
                                S4[Storage Server 2-2]
                            end
                        end
                        
                        C1 --> T1
                        C2 --> T1
                        C3 --> T2
                        T1 --> S1
                        T1 --> S3
                        T2 --> S2
                        T2 --> S4
                        S1 -.同步.-> S2
                        S3 -.同步.-> S4
                        
                        style C1 fill:#e0e7ff,stroke:#6366f1
                        style C2 fill:#e0e7ff,stroke:#6366f1
                        style C3 fill:#e0e7ff,stroke:#6366f1
                        style T1 fill:#fef3c7,stroke:#f59e0b
                        style T2 fill:#fef3c7,stroke:#f59e0b
                        style S1 fill:#d1fae5,stroke:#10b981
                        style S2 fill:#d1fae5,stroke:#10b981
                        style S3 fill:#d1fae5,stroke:#10b981
                        style S4 fill:#d1fae5,stroke:#10b981
                </div>
            </div>
        </div>
    </section>

    <!-- Core Components -->
    <section class="container mx-auto px-6 py-16">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-4xl font-bold text-center mb-16 serif-font">核心组件详解</h2>
            
            <!-- Tracker Server -->
            <div class="mb-16">
                <div class="bg-gradient-to-r from-yellow-50 to-orange-50 rounded-2xl p-8 md:p-12 card-hover">
                    <div class="flex items-start">
                        <div class="bg-yellow-400 rounded-full p-4 mr-6 feature-icon">
                            <i class="fas fa-route text-2xl text-white"></i>
                        </div>
                        <div class="flex-1">
                            <h3 class="text-2xl font-bold mb-4 text-gray-800">
                                <i class="fas fa-server mr-2 text-yellow-500"></i>Tracker Server - 智能调度中心
                            </h3>
                            <p class="text-gray-700 mb-6 leading-relaxed">
                                Tracker Server 是整个 FastDFS 系统的调度中心，负责管理和协调客户端与 Storage Server 之间的交互。它记录了所有存储组及其下属 Storage Server 的信息，并根据当前的负载和文件大小等因素，为客户端选择合适的 Storage Server 来存储或访问文件。
                            </p>
                            <div class="grid md:grid-cols-2 gap-6">
                                <div class="bg-white rounded-lg p-6 shadow-md">
                                    <h4 class="font-bold text-lg mb-3 text-gray-800">
                                        <i class="fas fa-tasks mr-2 text-yellow-500"></i>核心职责
                                    </h4>
                                    <ul class="space-y-2 text-gray-600">
                                        <li><i class="fas fa-check-circle mr-2 text-green-500"></i>路由请求：接收并分发客户端请求</li>
                                        <li><i class="fas fa-check-circle mr-2 text-green-500"></i>监控管理：实时监控存储节点状态</li>
                                        <li><i class="fas fa-check-circle mr-2 text-green-500"></i>负载均衡：智能选择最优存储节点</li>
                                    </ul>
                                </div>
                                <div class="bg-white rounded-lg p-6 shadow-md">
                                    <h4 class="font-bold text-lg mb-3 text-gray-800">
                                        <i class="fas fa-shield-alt mr-2 text-yellow-500"></i>高可用保障
                                    </h4>
                                    <p class="text-gray-600">
                                        支持多 Tracker Server 部署，通过主备或集群模式实现高可用性，确保调度服务永不中断。
                                    </p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Storage Server -->
            <div class="mb-16">
                <div class="bg-gradient-to-r from-green-50 to-emerald-50 rounded-2xl p-8 md:p-12 card-hover">
                    <div class="flex items-start">
                        <div class="bg-green-500 rounded-full p-4 mr-6 feature-icon">
                            <i class="fas fa-database text-2xl text-white"></i>
                        </div>
                        <div class="flex-1">
                            <h3 class="text-2xl font-bold mb-4 text-gray-800">
                                <i class="fas fa-hdd mr-2 text-green-500"></i>Storage Server - 数据存储引擎
                            </h3>
                            <p class="text-gray-700 mb-6 leading-relaxed">
                                Storage Server 是 FastDFS 系统中实际存储文件的节点。它不仅保存文件数据，还记录文件的元数据（如文件大小、上传时间等）。
                            </p>
                            <div class="grid md:grid-cols-3 gap-4">
                                <div class="bg-white rounded-lg p-5 shadow-md">
                                    <h4 class="font-bold mb-2 text-gray-800">
                                        <i class="fas fa-layer-group mr-2 text-green-500"></i>存储组织
                                    </h4>
                                    <p class="text-sm text-gray-600">按组（Group）划分，组内数据自动同步，保证冗余存储</p>
                                </div>
                                <div class="bg-white rounded-lg p-5 shadow-md">
                                    <h4 class="font-bold mb-2 text-gray-800">
                                        <i class="fas fa-fingerprint mr-2 text-green-500"></i>文件标识
                                    </h4>
                                    <p class="text-sm text-gray-600">每个文件分配唯一 ID，包含组信息和存储路径</p>
                                </div>
                                <div class="bg-white rounded-lg p-5 shadow-md">
                                    <h4 class="font-bold mb-2 text-gray-800">
                                        <i class="fas fa-expand-alt mr-2 text-green-500"></i>弹性扩展
                                    </h4>
                                    <p class="text-sm text-gray-600">支持动态添加节点，无缝扩展存储容量</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Client -->
            <div class="mb-16">
                <div class="bg-gradient-to-r from-blue-50 to-indigo-50 rounded-2xl p-8 md:p-12 card-hover">
                    <div class="flex items-start">
                        <div class="bg-blue-500 rounded-full p-4 mr-6 feature-icon">
                            <i class="fas fa-laptop-code text-2xl text-white"></i>
                        </div>
                        <div class="flex-1">
                            <h3 class="text-2xl font-bold mb-4 text-gray-800">
                                <i class="fas fa-plug mr-2 text-blue-500"></i>Client - 智能接入层
                            </h3>
                            <p class="text-gray-700 mb-6 leading-relaxed">
                                客户端是与 FastDFS 系统交互的应用程序或工具。它负责将文件上